< previous page page_147 next page >

Page 147
    With PropBag
        m_UpperCase = .ReadProperty("UpperCase", m_def_UpperCase)
        m_Digits = .ReadProperty("Digits", m_def_Digits)
        m_Numeric = .ReadProperty("Numeric", m_def_Numeric)
        '
        m_CheckRange = .ReadProperty("CheckRange", m_def_CheckRange)
        m_LowValue = .ReadProperty("LowValue", m_def_LowValue)
        m_HighValue = .ReadProperty("HighValue", m_def_HighValue)
        '
        m_CheckSize = .ReadProperty("CheckSize", m_def_CheckSize)
        m_MinLength = .ReadProperty("MinLength", m_def_MinLength)
        m_MaxLength = .ReadProperty("MaxLength", m_def_MaxLength)
       '
        Text1.Text = .ReadProperty("Text", UserControl.Name)
    End With
    '
End Sub
Now refer to Listing 5.33 to update the WriteProperties event.
Type.gifListing 5.33. Modifying the WriteProperties event.
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
    '
    ' save design-time property values
    '
    With PropBag
        Call .WriteProperty("UpperCase", m_UpperCase, m_def_UpperCase)
        Call .WriteProperty("Digits", m_Digits, m_def_Digits)
        Call .WriteProperty("Numeric", m_Numeric, m_def_Numeric)
        '
        Call .WriteProperty("CheckRange", m_CheckRange, m_def_CheckRange)
        Call .WriteProperty("LowValue", m_LowValue, m_def_LowValue)
        Call .WriteProperty("HighValue", m_HighValue, m_def_HighValue)
        '
        Call .WriteProperty("CheckSize", m_CheckSize, m_def_CheckSize)
        Call .WriteProperty("MinLength", m_MinLength, m_def_MinLength)
        Call .WriteProperty("MaxLength", m_MaxLength, m_def_MaxLength)
        '
        Call .WriteProperty("Text", Text1.Text, UserControl.Name)
    End With
    '
End Sub
Now that you've handled the housekeeping chores for this option, you're ready to code the new properties. Listing 5.34 shows the Let and Get methods for the three new properties.

 
< previous page page_147 next page >

If you like this book, buy it!